#include "PatientHandler.h"
PatientHandler::PatientHandler(const SocketStream * stream, Reactor * reactor)
  : reactor_(reactor), connection_(stream)
{
  reactor_->registerHandler(this, READ_EVENT);
}

void PatientHandler::handleEvent (Handle h, EventType et)
{
  if (et == READ_EVENT)
    {
      std::string firstValue;
      std::string secondValue;
      		
      std::stringstream message(connection_->recv());
      std::getline(message, firstValue, '\n');	
      std::getline(message, secondValue, '\n');
      std::cout << "some patient value: " << firstValue << std::endl;
      std::cout << "some other patient value: " << secondValue << std::endl;
    }
}

Handle PatientHandler::getHandle() const
{
  return connection_->getHandle();
}
 


